package com.controller;

import com.alibaba.fastjson.JSON;
import com.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@Transactional
@RequestMapping("/dept")
public class DepartmentController {
    @Autowired
    public DepartmentService departmentService;
    @RequestMapping("/list")
    @ResponseBody
    public String deptlist(){
        return JSON.toJSONString(departmentService.findAllDept());
    }
}
